﻿<vw:WindowBaseView x:Class="WcfClientGenerator.UI.View.CodeGenerationWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vwm="clr-namespace:WcfClientGenerator.UI.ViewModel"
             xmlns:vw="clr-namespace:Addins.UI.View;assembly=Addins.UI.v2"
             xmlns:uc="clr-namespace:WcfClientGenerator.UI.UserControls"
             xmlns:cv="clr-namespace:WcfClientGenerator.UI.Converters"
             xmlns:model="clr-namespace:WcfClientGenerator.Model.Config;assembly=WcfClientGenerator.Model.v2"
             xmlns:ctl="clr-namespace:WcfClientGenerator.UI.Controls"
             Height="200" Width="300" WindowStartupLocation="CenterScreen"
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="300"
             Title="Code Generation"
             Style="{DynamicResource noBorderWindowStyle}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/WcfClientGenerator.UI.v2;component/Resources/common.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <cv:ProcessStatusVisibilityConverter x:Key="processStatusVisibilityConverter" />
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Border BorderBrush="Transparent" BorderThickness="0" Margin="10">
            <Border.Effect>
                <DropShadowEffect BlurRadius="10" ShadowDepth="5" />
            </Border.Effect>

            <Grid x:Name="grdRoot"
                Style="{StaticResource rootLayoutStyle}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Border BorderThickness="0" CornerRadius="5" BorderBrush="Black"/>

                <Rectangle
                    x:Name="caption"
                    Grid.Row="0"
                    Style="{DynamicResource captionRectangleStyle}" />
                <TextBlock
                    x:Name="txtTitle"
                    Grid.Row="0"
                    Style="{DynamicResource titleStyle}"
                    Text="Generate Code" />

                <uc:AnalyzingView x:Name="analyzingView" 
                                  Grid.Row="1" Visibility="{Binding Path=ProcessStatus, Converter={StaticResource processStatusVisibilityConverter}, ConverterParameter=Analyzing}" />
                <uc:GeneratingView x:Name="generatingView" 
                           Grid.Row="1" Visibility="{Binding Path=ProcessStatus, Converter={StaticResource processStatusVisibilityConverter}, ConverterParameter=Generating}" />
                <uc:FinishedView x:Name="finishedView" 
                         Grid.Row="1" Visibility="{Binding Path=ProcessStatus, Converter={StaticResource processStatusVisibilityConverter}, ConverterParameter=Finished}" />
                <Grid Margin="0,7,4,4"
                      Grid.Row="2" 
                      HorizontalAlignment="Right" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ctl:ImageButton x:Name="btnCancel" 
                    Margin="0,0,0,2" 
                    HorizontalAlignment="Center"
                    Command="{Binding Path=CancelProcessCommand}"
                    ToolTip="{Binding Path=CloseText}"
                    Style="{DynamicResource roundButtonStyle}"
                    NormalImage="/WcfClientGenerator.UI.v2;component/Images/cancel_black.png"
                    HoverImage="/WcfClientGenerator.UI.v2;component/Images/cancel_white.png"
                    PressedImage="/WcfClientGenerator.UI.v2;component/Images/cancel_darkgrey.png"
                    DisabledImage="/WcfClientGenerator.UI.v2;component/Images/cancel_grey.png" />
                    <TextBlock 
                    Grid.Row="1"
                    Style="{DynamicResource buttonLabelStyle}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Text="{Binding Path=CloseText}" />
                </Grid>
            </Grid>
        </Border>
    </Grid>
</vw:WindowBaseView>
